<include file="public@header" />
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }

    .btn-cancel-thumbnail {
        margin-top: 5px;
    }

    #photos,
    #files {
        margin-bottom: 0;
    }

    .row-bottom {
        margin-bottom: 20px;
    }

    .title {
        display: inline-block;
        width: 100%;
        background-color: aliceblue;
        padding: 8px;
        margin-bottom: 20px;
        .line {
            display: inline-block;
            width: 2px;
            height: 12px;
            background-color: lightblue;
            margin-right: 6px;
        }
        .content {
            display: inline-block;
            font-weight: bold;
        }
    }
</style>
</head>
<body>
    <block name="head">
        <link rel="stylesheet" href="__STATIC__/css/mall.css?v={$_static_version}"></link>
        <include file="theme/functions"/>
    </block>
    <block name="scripts">
        <include file="theme/scripts"/>
    </block>
    <div class="wrap js-check-wrap">
        <form action="{:url('Interior/addPost')}" method="post" class="form-horizontal js-ajax-form">
            <div class="title"><div class="line"></div><div class="content">数藏商城管理</div></div>
            <foreach name="scScreenArray" item="vo" key="index">
                <div class="row-bottom">
                    <input type="hidden" name="scScreens[{$index}][id]" value="{$vo.id}">
                    <label for="input-tag_name" class="col-sm-1 col-form-label text-sm-end"><span class="form-required"></span>大屏管理：</label>
                    <div class="col-sm-11">
                        <php>$active_true_checked=($vo['big_screen_type']==1)?"checked":"";</php>
                        <php>$active_false_checked=($vo['big_screen_type']==2)?"checked":"";</php>
                        <php>$old_video=($vo['big_screen_type']==2)?$vo['big_screen_url']:"";</php>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-sc-radio1" name="scScreens[{$index}][big_screen_type]" 
                                    value="1" {$active_true_checked}>
                                <label class="form-check-label" for="status-radio1">宣传图片</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <php>                                    
                                    $screenItem = [];
                                    $screenItem['big_screen_url']['value'] = ($vo['big_screen_type']==1)?$vo['big_screen_url']:"";
                                    $screenItem['big_screen_url']['type'] = "image2";
                                    $dataName = "scScreens[". $index . ']';
                                    $widgetName = "scScreens". $index;
                                </php>
                                {:_parse_vars($screenItem, $dataName, 1, $widgetName)}
                                <small class="text-muted">{:lang('UPLOAD_SINGLE_IMAGE_FORMAT_500K')}</small>
                            </div>
                        </div>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-sc-radio0"
                                    name="scScreens[{$index}][big_screen_type]" value="2" {$active_false_checked}>
                                <label class="form-check-label" for="status-radio0">宣传视频</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <input id="file-sc-video" class="form-control" type="text"
                                    name="scScreens[{$index}][big_video_url]" value="{$old_video}"
                                    placeholder="请上传宣传视频" style="width: 200px;">
                                <if condition="$vo.big_screen_type == 2">
                                    <notempty name="vo.big_screen_url">
                                        <a class="btn btn-info" id="file-sc-video-preview"
                                            href="{:cmf_get_file_download_url($vo.big_screen_url)}" target="_blank"><i
                                                class="fa fa-play-circle fa-fw"></i></a>
                                    </notempty>
                                </if>
                                <a class="btn btn-default"
                                    href="javascript:uploadOne('视频上传','#file-sc-video','video');"><i
                                        class="fa fa-upload fa-fw"></i></a>
                                <a class="btn btn-danger"
                                    href="javascript:(function(){$('#file-sc-video').val('');})();"><i
                                        class="fa fa-trash fa-fw"></i></a>
                                <div><small class="text-muted">{:lang('UPLOAD_VIDEO_FORMAT_50M')}</small></div>
                            </div>
                        </div>
                    </div>
                </div>
            </foreach>

            <div class="title"><div class="line"></div><div class="content">美容院管理</div></div>
            <foreach name="mrScreenArray" item="vo" key="index">
                <div class="row-bottom">
                    <input type="hidden" name="mrScreens[{$index}][id]" value="{$vo.id}">
                    <label for="input-tag_name" class="col-sm-1 col-form-label text-sm-end"><span
                            class="form-required"></span>大屏管理：</label>
                    <div class="col-sm-11">
                        <php>$active_true_checked=($vo['big_screen_type']==1)?"checked":"";</php>
                        <php>$active_false_checked=($vo['big_screen_type']==2)?"checked":"";</php>
                        <php>$old_video=($vo['big_screen_type']==2)?$vo['big_screen_url']:"";</php>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-mr-radio1"
                                    name="mrScreens[{$index}][big_screen_type]" value="1" {$active_true_checked}>
                                <label class="form-check-label" for="status-radio1">宣传图片</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <php>                                    
                                    $screenItem = [];
                                    $screenItem['big_screen_url']['value'] = ($vo['big_screen_type']==1)?$vo['big_screen_url']:"";
                                    $screenItem['big_screen_url']['type'] = "image2";
                                    $dataName = "mrScreens[". $index . ']';
                                    $widgetName = "mrScreens". $index;
                                </php>
                                {:_parse_vars($screenItem, $dataName, 1, $widgetName)}   
                                <small class="text-muted">{:lang('UPLOAD_SINGLE_IMAGE_FORMAT_500K')}</small>         
                            </div>
                        </div>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-mr-radio0"
                                    name="mrScreens[{$index}][big_screen_type]" value="2" {$active_false_checked}>
                                <label class="form-check-label" for="status-radio0">宣传视频</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <input id="file-mr-video" class="form-control" type="text"
                                    name="mrScreens[{$index}][big_video_url]" value="{$old_video}"
                                    placeholder="请上传宣传视频" style="width: 200px;">
                                <if condition="$vo.big_screen_type == 2">
                                    <notempty name="vo.big_screen_url">
                                        <a class="btn btn-info" id="file-mr-video-preview"
                                            href="{:cmf_get_file_download_url($vo.big_screen_url)}" target="_blank"><i
                                                class="fa fa-play-circle fa-fw"></i></a>
                                    </notempty>
                                </if>
                                <a class="btn btn-default"
                                    href="javascript:uploadOne('视频上传','#file-mr-video','video');"><i
                                        class="fa fa-upload fa-fw"></i></a>
                                <a class="btn btn-danger"
                                    href="javascript:(function(){$('#file-mr-video').val('');})();"><i
                                        class="fa fa-trash fa-fw"></i></a>                                
                                <div><small class="text-muted">{:lang('UPLOAD_VIDEO_FORMAT_50M')}</small></div>
                            </div>
                        </div>
                    </div>
                </div>
            </foreach>

            <div class="row-bottom">
                <label for="input-tag_name" class="col-sm-1 col-form-label text-sm-end"><span class="form-required"></span>图片管理：</label>
                <div class="col-sm-11">         
                    
                    <div class="col-sm-12"><small class="text-muted">{:lang('UPLOAD_SINGLE_IMAGE_FORMAT_500K')}</small></div>
                    <foreach name="mrPictureArray" item="vo" key="index">
                        <input type="hidden" name="mrPictures[{$index}][id]" value="{$vo.id}">
                        <div class="form-inline col-sm-2 row-bottom">
                            <div class="form-inline">
                                <php>                                    
                                    $screenItem = [];
                                    $screenItem['picture_url']['value'] = $vo['picture_url'];
                                    $screenItem['picture_url']['type'] = "image2";
                                    $dataName = "mrPictures[". $index . ']';
                                    $widgetName = "mrPictures". $index;
                                </php>
                                {:_parse_vars($screenItem, $dataName, 1, $widgetName)}     
                                <div style="font-size: 12px; text-align: left; padding-left: 50px;">{$index+1}号点位</div>
                            </div>
                        </div>
                    </foreach>
                </div>
            </div>

            <div class="title"><div class="line"></div><div class="content">零售区管理</div></div>
            <foreach name="lsScreenArray" item="vo" key="index">
                <div class="row-bottom">
                    <input type="hidden" name="lsScreens[{$index}][id]" value="{$vo.id}">
                    <label for="input-tag_name" class="col-sm-1 col-form-label text-sm-end"><span
                            class="form-required"></span>{$index+1}号大屏管理：</label>
                    <div class="col-sm-11">
                        <php>$active_true_checked=($vo['big_screen_type']==1)?"checked":"";</php>
                        <php>$active_false_checked=($vo['big_screen_type']==2)?"checked":"";</php>
                        <php>$old_video=($vo['big_screen_type']==2)?$vo['big_screen_url']:"";</php>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-ls{$index}-radio1"
                                    name="lsScreens[{$index}][big_screen_type]" value="1" {$active_true_checked}>
                                <label class="form-check-label" for="status-radio1">宣传图片</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <php>                                    
                                    $screenItem = [];
                                    $screenItem['big_screen_url']['value'] = ($vo['big_screen_type']==1)?$vo['big_screen_url']:"";
                                    $screenItem['big_screen_url']['type'] = "image2";
                                    $dataName = "lsScreens[". $index . ']';
                                    $widgetName = "lsScreens". $index;
                                </php>
                                {:_parse_vars($screenItem, $dataName, 1, $widgetName)}
                                <small class="text-muted">{:lang('UPLOAD_SINGLE_IMAGE_FORMAT_500K')}</small>
                            </div>
                        </div>
                        <div class="form-inline col-sm-10 row-bottom">
                            <div class="col-sm-2 form-check form-check-inline">
                                <input class="form-check-input" type="radio" id="status-ls{$index}-radio0"
                                    name="lsScreens[{$index}][big_screen_type]" value="2" {$active_false_checked}>
                                <label class="form-check-label" for="status-radio0">宣传视频</label>
                            </div>
                            <div class="col-sm-8 form-inline">
                                <input id="file-ls{$index}-video" class="form-control" type="text"
                                    name="lsScreens[{$index}][big_video_url]" value="{$old_video}"
                                    placeholder="请上传宣传视频" style="width: 200px;">
                                <if condition="$vo.big_screen_type == 2">
                                    <notempty name="vo.big_screen_url">
                                        <a class="btn btn-info" id="file-ls{$index}-video-preview"
                                            href="{:cmf_get_file_download_url($vo.big_screen_url)}" target="_blank"><i
                                                class="fa fa-play-circle fa-fw"></i></a>
                                    </notempty>
                                </if>
                                <a class="btn btn-default"
                                    href="javascript:uploadOne('视频上传','#file-ls{$index}-video','video');"><i
                                        class="fa fa-upload fa-fw"></i></a>
                                <a class="btn btn-danger"
                                    href="javascript:(function(){$('#file-ls{$index}-video').val('');})();"><i
                                        class="fa fa-trash fa-fw"></i></a>                            
                                <div><small class="text-muted">{:lang('UPLOAD_VIDEO_FORMAT_50M')}</small></div>
                            </div>
                        </div>
                    </div>
                </div>
            </foreach>

            <div class="form-group row-bottom" style=""> 
                <div class="col-sm-10" style="position: fixed;bottom: 10px;background: #ddd;text-align: center;">
                    <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                    <a class="btn btn-default" href="{:url('Interior/index')}">{:lang('BACK')}</a>
                </div>
            </div>
        </form>



    </div>
    <script type="text/javascript" src="__STATIC__/js/admin.js?v={$_static_version}"></script>
    <script type="text/javascript">
        //编辑器路径定义
        var editorURL = GV.WEB_ROOT;
    </script>
    <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        $(function () {

            editorcontent = new baidu.editor.ui.Editor();
            editorcontent.render('content');
            try {
                editorcontent.sync();
            } catch (err) {
            }

            $('#more-template-select').val("{$post.more.template|default=''}");
        });
    </script>
</body>

</html>